class C {
    protected name: string;
    protected num: number;

    constructor(name: string, num ?: number) {
        this.name = name;
        this.num = num;
    }

    getNum():number{
       if(this.num === undefined){
           return 10;
       }else{
           return this.num;
       }

    }

    doSome(n: number) {
        for (let i = 0; i <= n; i++) {
            console.log(this.name);
        }
    }
}

class CA extends C {
    CANumber: number = 11;

    doSome() {
        super.doSome(2);
        console.warn(this.CANumber);
    }
}

class CB extends C {
}


(() => {
    let c1 = new CA('lbl');
    // c1.doSome();
    console.log(c1.getNum());
})()
